﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CheckDB
{
    public partial class frmView : Form
    {
        public frmView(List<string> lView, List<string> lTable, List<string>  lColumn)
        {
            InitializeComponent();
            DataTable TableView = new DataTable();

            DataColumn Columm = new DataColumn();
            Columm.ColumnName = Columm.Caption = "STT";
            Columm.DataType = System.Type.GetType("System.Int32");
            Columm.AllowDBNull = false;
            Columm.AutoIncrement = true;
            Columm.AutoIncrementSeed = Columm.AutoIncrementStep = 1;
            TableView.Columns.Add(Columm);
            DataColumn Columm1 = new DataColumn();
            Columm1.ColumnName = Columm1.Caption = "Tenview";
            Columm1.DataType = System.Type.GetType("System.String");
            TableView.Columns.Add(Columm1);
            for (int i = 0; i < lColumn.Count; i++)
            {
                TableView.Rows.Add(i);
                int a = TableView.Rows.Count;
                TableView.Rows[a - 1]["Tenview"] = lColumn[i].ToString();
            }
            for (int i = 0; i < lTable.Count; i++)
            {
                TableView.Rows.Add(i);
                int a = TableView.Rows.Count;
                TableView.Rows[a - 1]["Tenview"] = lTable[i].ToString();
            }
            for (int i = 0; i < lView.Count; i++)
            {
                TableView.Rows.Add(i);
                int a = TableView.Rows.Count;
                TableView.Rows[a - 1]["Tenview"] = lView[i].ToString();
            }
            dataGridView1.DataSource = TableView;
        }
    }
}
